<#include "../../page.ftl" />
<#include "../../display.ftl" />
<#assign security=JspTaglibs["/WEB-INF/security.tld"] />
<table class="table table-datatable table-gray check_table">
    <thead>
    <tr>
        <th style="width: 35px;"><input id="checkAll" type="checkbox" value=""></th>
        <th>登录名称</th>
        <th>用户名称</th>
        <th>性别</th>
        <th>所属机构</th>
        <th>用户状态</th>
        <th>用户类型</th>
        <th>排序号</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <#if usersTable.rows??>
        <#list usersTable.rows as user>
        <tr>
            <td><input name="ids" type="checkbox" value="${user.id?c}"></td>
            <td>${user.loginName!''}</td>
            <td>${user.userName!''}</td>
            <td>
                <@display list=sexTypeList value="${user.sex!''}"/>
            </td>
            <td>${user.orgName!''}</td>
            <td>
                <@display list=userStatusList value="${user.status!''}"/>
            </td>
            <td>
                <@display list=userTypeList value="${user.userType!''}"/>
            </td>
            <td>${user.sortNo!''}</td>
            <td>${user.remark!''}</td>
            <td>
                <@security.authorize ifAnyGranted="ROLE_USER_E">
                    <a title="编辑" class="btn btn-green btn-radio nopadding"
                       onclick="return popAddOrModify(${user.id?c});"><i class="fa fa-edit"></i></a>
                </@security.authorize>
                <@security.authorize ifAnyGranted="ROLE_USER_ASSIGN_ROLE">
                    <a title="分配角色" class="btn btn-green btn-radio nopadding"
                       onclick="return popAssign('${user.loginName!''}');"><i class="fa fa-user-plus"></i></a>
                </@security.authorize>
                <@security.authorize ifAnyGranted="ROLE_USER_MODIFY_PASSWORD">
                    <a title="修改密码" class="btn btn-green btn-radio nopadding"
                       onclick="return popModifyPassword(${user.id?c});"><i class="fa fa-lock"></i></a>
                </@security.authorize>
            </td>
        </tr>
        </#list>
    </#if>
    </tbody>
</table>
<#if usersTable??>
    <@page table=usersTable formId="search_user_table"/>
</#if>